import serves from './axios'
import store from '@/store/index';

// 首页解决方案

// 获取首页解决方案列表
export function getSolutionList() {
    return serves({
        url: '/admin/getSolutionList',
        method: 'post',
        data: {
            token: store.state.token
        }
    })
}

// 获取首页解决方案详情
export function getSolutionInfo(id) {
    return serves({
        url: '/admin/getSolutionInfo',
        method: 'post',
        data: {
            token: store.state.token,
            id
        }
    })
}

// 新增首页解决方案
export function addSolution(data) {
    return serves({
        url: '/admin/addSolution',
        method: 'post',
        data: {
            token: store.state.token,
            ...data
        }
    })
}

// 删除首页解决方案
export function delSolution(id) {
    return serves({
        url: '/admin/delSolution',
        method: 'post',
        data: {
            token: store.state.token,
            id
        }
    })
}

// 修改首页解决方案
export function updateSolution(data) {
    return serves({
        url: '/admin/updateSolution',
        method: 'post',
        data: {
            token: store.state.token,
            ...data,
        }
    })
}